1. Field of the Invention
The present invention relates to a method and an apparatus for processing outline font data indicative of outlines of characters and, more particularly to the improvement in forming element structures based on the outline font data and used for drawing of the characters on a display screen or a paper.
2. Description of the Related Art
In recent years, the use of word processors and computers such as a personal computers executing a word processing application has grown and developed remarkably. Such word processors or computers make it possible to create a presentable document with ease and, as a consequence, not only formal documents such as contracts exchanged between corporations but also personal documents such as letters privately exchanged are created in general with the aid of the word processor or computer.
In creating a manuscript, a writer can draw characters of favorite size and design and cause the characters to reflect the writer's personality with ease. On the other hand, when creating a document with the aid of an outmoded word processor or personal computer, the writer can hardly cause the characters to reflect the writer's personality because of the fact that such a word processor or personal computer provides only a few character sets of predetermined size and design for the writer. The recent growth and development of the computer technology, however, enables the word processor or personal computer to provide a wide variety of character sets for the writer.
The sets of characters drawn through the word processor or computer are generally called "fonts" and are classified into bit map font groups and outline font groups in accordance with their own data structure and data processing technique. The fonts are stored in a storage device such as a hard disk or ROM (Read-only Memory).
Each of the characters of a bit map font is represented by plural bunches of dots each corresponding to each of picture elements provided for a drawing output device such as a display device or printing device and, accordingly, the finesse of the bit map font depends upon the resolution of the drawing output device. Provided that bit map font data of appropriate character sizes is stored in the storage device of the word processor or personal computer, fine characters can be drawn extremely quickly by the drawing output device or printing device on a screen or on paper. The reason for this is that the process of displaying or printing out the bit map font requires no complicated calculation by the drawing output device or computer. If, however, the character is enlarged with respect to the original character size and displayed or printed out, the outlines of the characters become jagged. This means that the characters have reduced drawing quality and, as a consequence, that the bit map font is unsuitable to change the character size.
On the other hand, the outline font is suitable to change the character size and has been frequently used in recent years. In general, each of the characters of the outline font is formed by drawing the outlines of the character and painting regions surrounded by the outlines. If, therefore, the, character is enlarged with respect to the original character size and displayed or printed out, the outlines of the characters are prevented from becoming jagged. Data indicative of the outline font are contained in a outline font dictionary stored in the storage device. The characters of the outline font are drawn by a display or printing device after the outline font data is processed in a manner described as follows.
FIG. 1 shows in part an example of the outline font dictionary containing the outline font data and stored in a storage device. The outline font dictionary is formed on the assumption that each of the outlines of the characters is divided into a plurality of outline sections which are drawn in turn to form the outline in a dictionary coordinate system of the outline font dictionary. The dictionary coordinate system is defined by x-axis and y-axis intersecting each other at a right angle and extending horizontally and vertically, respectively. The outline font dictionary partly shown in FIG. 1 comprises drawing data groups DG1 to DG7 on the basis of which an outline shown in FIG. 2 is drawn in the dictionary coordinate system. The drawing data group DG1 comprises a drawing point movement operator indicating that a drawing point provided for the dictionary coordinate system is moved from the origin to a destination point in the dictionary coordinate system without drawing, and a coordinate data set representative of an absolute x-coordinate and an absolute y-coordinate, i.e., coordinates (0, 100) of the destination point in the dictionary coordinate system. The drawing data group DG2 comprises a rectilinear segment drawing operator of an absolute coordinate type indicating the drawing point is moved on a slanted straight line from the current point to a destination point in the dictionary coordinate system to draw a slantindicular rectilinear segment, and a coordinate data set representative of absolute coordinates (100, 200) of the destination point in the dictionary coordinate system. The drawing data group DG3 comprises a horizontal rectilinear segment drawing operator of an absolute coordinate type indicating that the drawing point is horizontally moved on a straight line from the current point to a destination point in the dictionary coordinate system to draw a horizontal rectilinear segment, and a coordinate data set representative of absolute x-coordinate (150) of the destination point in the dictionary coordinate system. The drawing data group DG4 comprises a vertical rectilinear segment drawing operator of a relative coordinate type indicating that the drawing point is vertically moved on a straight line from the current point to a destination point to draw a vertical rectilinear segment, and a coordinate data set representative of relative y-coordinate (-200) of the destination point with respect to the current point in the dictionary coordinate system. The drawing data group DG5 comprises a horizontal rectilinear segment drawing operator of a relative coordinate type indicating that the drawing point is horizontally moved on a straight line from the current point to a destination point to draw a horizontal rectilinear segment, and a coordinate data set representative of relative x-coordinate (-50) of the destination point in the dictionary coordinate system. The drawing data group DG6 comprises a curved segment drawing operator indicating that the drawing point is moved on a curved line from the current point to a destination point to draw a curved segment, and three coordinated data sets representative of absolute coordinates (50, 0), (0, 50) and (0, 100) of three control points, respectively, which define the curved segment in cooperation with the current point. The drawing data group DG7 comprises an outline data ending operator indicating the ending of an outline partly forming the outlines of the character.
On the basis of the drawing data groups DG1 through DG7 shown in FIG. 1, there is drawn an outline which forms part of a character and consists of rectilinear segments LS2-LS5 and a curved segment CS6 shown in FIG. 2. Firstly, based on the drawing data group DG1, the drawing point is vertically moved straight from the origin of the coordinates (0, 0) to a first destination point D1 of the coordinates (0, 100) without drawing. Based on the drawing data group DG 2, the drawing point is moved on a slanted straight line from the first point D1 of the coordinates (0, 100) to a second point D2 of the coordinates (100, 200) to draw a slantindicular rectilinear segment LS2. Based on the drawing data group DG3, the drawing point is horizontally moved on a straight line from the second point D2 of the coordinates (100, 200) to a third point D3 of the coordinates (150, 200) to draw a horizontal rectilinear segment LS3. Based on the drawing data group DG4, the drawing point is vertically moved on a straight line from the third point D3 of the coordinates (150, 200) to a fourth point D4 of the coordinates (150, 0) to draw a vertical rectilinear segment LS4. Based on the drawing data group DG5, the drawing point is horizontally moved on a straight line from the fourth point DG4 of the coordinates (150, 0) to a fifth point D5 of the coordinates (100, 0) to draw a horizontal rectilinear segment LS5. Based on the drawing data group DG6, the drawing point is moved on a curved line from the fifth point D5 of the coordinates (100, 0) to the first point D1 of the coordinates (100, 0) to draw a curved segment CS6. A series of drawing operations set forth above is terminated by the drawing data group DG7 and, thus, the outline of the character is completed. It should be kept in mind that the outline shown in FIG. 2 represents a simple figure and has been selected in order to simplify the description. The outline is not included in the outline of a character actually put to use. As will be understood from the foregoing description and FIGS. 1 and 2, the divided outline sections are defined by the drawing data groups DG2 through DG6, respectively. The curved segment based on the drawing data group DG6 is a so-called Bezier cubic curve which is a cubic spline approximation to a set of four control points. In FIG. 2, the four control points correspond to points D5, D61, D62 and D63(=D1), respectively. The curved segment passes through the points D5 and D63 and has a shape that is specified by the position of the points D61 and D62 with respect to the points D5 and D63.
In practical drawing operation, after the outline font data are read out from the outline font dictionary, the read outline font data are processed as described below and stored in a storage device for a short time. The outline font is drawn in accordance with the processed data read out from the storage device. The processing technique will be described in detail hereinafter with reference to FIGS. 3-6. A conventional outline font data processing system is shown in FIG. 3 as comprising a path constructing unit 100, a font drawing unit 150 and a common storage unit 140 referred to by the path constructing unit 100 and the font drawing unit 150 without discrimination.
The path constructing unit 100 comprises a dispatching unit 101, drawing point movement data processing unit 102, a rectilinear segment drawing data processing unit 103, a horizontal rectilinear segment drawing data processing unit 104, a vertical rectilinear segment drawing data processing unit 105, a curved segment drawing data processing unit 106 and an outline ending data processing unit 107. Upon receiving an instruction to draw a character from a control unit 120, the path constructing unit 100 reads out outline font data corresponding to the character from an outline font dictionary 130. The outline font data read out from the outline font dictionary 130 are judged as to the operator type by the dispatching unit 101. If the read outline font data is of a drawing point movement operator type, the read out outline font data are transferred to the drawing point movement data processing unit 102. If the data is of a rectilinear segment drawing operator type; the read out outline font data are transferred to the rectilinear segment drawing data processing unit 103. If the data is of a horizontal rectilinear segment drawing operator type, the read out outline font data are transferred to the horizontal rectilinear segment drawing data processing unit 104. If the data is of a vertical rectilinear segment drawing operator type, the read out outline font data are transferred to the vertical rectilinear segment drawing data processing unit 105. If the data is of a curved segment drawing operator type, the read out outline font data are transferred to the curved segment drawing data processing unit 106. If the data is of an outline data ending operator type, the read out outline font data are transferred to the outline ending data processing unit 107. In the data processing units 102-107, element structures are formed in accordance with the transferred outline font data and stored in a memory area previously reserved on the common storage unit 140. The element structures thus formed are connected in serial, thereby to construct a graphic path. Each of the element structures comprises a pointer indicative of a location of the following element structure, element type data representative of an element type of each of the element structures, a coordinate data set indicative of coordinates of a destination point in a drawing coordinate system provided for the drawing output device such as a display or printing device.
When drawing data groups A, B and C are read out by the path constructing unit 100 from the outline font dictionary 130 shown in FIG. 3, the drawing data group A is transferred to the drawing point movement data processing unit 102. On the other hand, the drawing data groups B and C are transferred to the rectilinear segment drawing data processing unit 103. The drawing point movement data processing unit 102 processes the drawing data group A to form a drawing point movement element structure A' shown in FIG. 3, while the rectilinear segment drawing data processing unit 103 processes the drawing data groups B and C to form rectilinear segment element structures B' and C' shown in FIG. 3, respectively.
The process of forming the rectilinear segment element structure B' will be described, by way of example, hereinafter. The procedure by the rectilinear segment drawing data processing unit 103 is shown in FIG. 4 as comprising three steps. In the first step, the coordinates (x2, y2) of the drawing data group B in the dictionary coordinate system are mapped onto the drawing output device coordinate system, so that coordinates (x'2, y'2) in the drawing output device coordinate system can be obtained. At the second step, a memory area on the common storage unit 140 is reserved for the rectilinear segment element structure B' and, afterwards, the rectilinear segment element structure B' is formed and stored in the reserved memory area. The element type data of the rectilinear segment element structure B' are set as indicating a rectilinear segment. The obtained coordinates (x'2, y'2) are substituted for coordinates (x, y) of the coordinate data set of the rectilinear segment element structure B'. At the third step, the rectilinear segment element structure B' is connected to the graphic path by substituting the address of the rectilinear segment element structure B' for the pointer of the drawing point movement element structure A'. The drawing point movement element structure A' and the rectilinear segment element structure C' are formed in a similar manner. The element type data of the drawing point movement element structure A' are set as indicating the movement of the drawing point. The coordinates (x'1, y'1) of the drawing movement element structure A' and the coordinates (x'3, y'3) of the rectilinear segment element structure C' are obtained by mapping the coordinates (x1, y1) of the drawing data group A and the coordinates (x3, y3) of the drawing data group C onto the drawing output device coordinate system, respectively. The horizontal and vertical rectilinear segment drawing data processing units 104 and 105 also process the outline font data in a similar manner.
On the other hand, another data processing technique applied to the curved segment drawing data processing unit 106 differs from the foregoing technique in specifying a plurality of approximate points positioned on and approximately defining a curved segment before an element structure forming step. As described above, the curved segment is Bezier cubic curve defined by the four control points including the current drawing point and, for this reason, the drawing data group indicative of the curved segment and contained in the outline font dictionary comprises three coordinate data sets respectively having coordinates of the three control points in the dictionary coordinate system.
The processing technique used by the curved segment drawing data processing unit 106 will be described hereinafter with reference to FIG. 5.
When the drawing data group indicative of the curved segment are read out by the path constructing unit 100 from the outline font dictionary 130, the coordinates of three points included in the read out drawing data group are mapped onto the drawing output device coordinate system in a step P1, thereby obtaining three coordinate data sets indicative of the three control points in the drawing output device coordinate system. At this time, the coordinates of four control points to be used for defining the curved segment in the drawing output device coordinate system are obtained because of the fact that coordinates of the current drawing point are identical with coordinates contained in the latest one of the previously formed element structures. The step P1 is followed by a step P2 in which coordinates of an approximate point following the current drawing point are specified. The step P2 proceeds to a step P3 to determine whether or not the specification of approximate points was completed. If the answer in the step P3 is in the negative "NO", the step P3 proceeds to a step P4 in which a memory area is reserved for a rectilinear segment element structure on the common storage unit 140. In a step P5, a first rectilinear segment element structure K shown in FIG. 6 are formed and stored in the reserved memory area of the common storage unit 140. The rectilinear segment element structure K indicates that the drawing point is moved on a straight line from the current point to the specified approximate point to draw a rectilinear segment approximately forming the curved segment in part. The element structure K is so constructed as to include coordinates (x'1, y'1) defining the first approximate point in the drawing output device coordinate system. The step P5 is followed by a step P6 to substitute the address of the rectilinear segment element structure K for a pointer of a previously formed element structure (not shown) and, as a consequence, the rectilinear segment element structure K is connected to a previously formed graphic path. The steps P2 through P6 are repeated until the rectilinear segment element structures respectively based on all the approximate points have been formed and connected to the graphic path. The graphic path thus constructed is shown in FIG. 6 as comprising the second and third rectilinear segment element structures L and M which indicate that a rectilinear segment is drawn so as to extend rectilinearly from the first approximate point to the second approximate point, and that a rectilinear segment is draw so as to extend rectilinearly from the second approximate point to the third approximate point, respectively.
The element structures thus formed by path constructing unit 100 collectively define the outlines of the character designated by the control unit 120 in the drawing coordinate system. When the control unit 120 sends a paint operator to the font drawing unit 150 by way of the path constructing unit 100, the font drawing unit 150 reads out the graphic path from the common storage unit 140 and then instructs the drawing output device to draw the character designated by the control unit 120, thereby displaying the character on a screen or printing the character on a paper.
Drawbacks are, however, encountered in the step of forming the element structures indicating the continuous rectilinear segments, adapted for such a prior art outline data processing system. One of the drawbacks is that the numbers of memory area reservations for the rectilinear segment element structures is increased when the outline is divided into numerous continuous rectilinear segments in part. The reason for this is that the rectilinear segment element structures are equal in number to the continuous rectilinear segments. The same reason results in another drawback in that the total size of the reserved memory areas are increased. A further drawback is that the font drawing unit takes a long time to draw the continuous rectilinear segments inasmuch as the font drawing unit is required to read out the numerous rectilinear segment element structures in order to draw the continuous rectilinear segments.
Likewise, drawbacks are encountered in the step of forming the element structures indicating a curved segment, adapted for such a prior art outline data processing system. One of the drawbacks is that the number of memory area reservations for the rectilinear segment element structures is increased because of the fact that the curved segment is approximately drawn by numerous short rectilinear segments to be indicated by the rectilinear segment element structures. The same reason results in another drawback in that the total size of the reserved memory areas is increased. A further drawback is that the font drawing unit must take long time out to draw the curved segment inasmuch as the font drawing unit is required to read out the numerous rectilinear segment element structures in order to draw the curved segment.